package com.llly.mapper;

import com.llly.pojo.Easybuy_user_address;
import com.llly.pojo.ShoppingCar;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ShoppingCarMapper {

    //添加购物车
    public int addShoppingCar(ShoppingCar sc);

    //根据当前登录用户 查询旗下购物车信息
    public List<ShoppingCar> showAllShoppingCar(@Param("uid") Integer uid);


    //添加购物车 的时候要查询验证商品
    public int  checkShopCar(@Param("pid")Integer pid,
                             @Param("uid") Integer uid);

    //修改购物车商品数量
    public int updateShopCarNumber(@Param("pid")Integer pid,
                                   @Param("uid") Integer uid,
                                   @Param("xiaoji") float xiaoji,
                                   @Param("num") Integer num);
    //获取总价
    public float getTotal(@Param("uid") Integer uid);

    //获得用户地址
    public List<Easybuy_user_address> getaddress(@Param("uid") Integer uid);

    //添加用户地址
    public int addAddress(@Param("uid") Integer uid,@Param("address") String address,@Param("remark") String remark);

    //付款后清空购物车
    public int updateCar(@Param("uid") Integer uid);

    //付款前修改购物车中商品
    public int delCar(@Param("uid") Integer uid,@Param("pid") Integer pid);

    //加购物车后修改商品库存
    public int xiugaikucun(Integer num,Integer pid);

}
